This repository was archived by the owner on Jun 26, 2020. It is now read-only.
Add initial Cranelift interpreter functionality#1351
Closed
abrown wants to merge 3 commits intobytecodealliance:masterfrom
Closed
Add initial Cranelift interpreter functionality#1351abrown wants to merge 3 commits intobytecodealliance:masterfrom
abrown wants to merge 3 commits intobytecodealliance:masterfrom
Conversation
bjorn3
suggested changes
Jan 15, 2020
| #[derive(Clone, Debug, PartialEq)] | ||
| pub enum Value { | ||
| Bool(bool), | ||
| Int(i64), |
Contributor
There was a problem hiding this comment.
I think this should be u64 instead. In any case it is important to not forget correct zero/sign extension.
Member
Author
There was a problem hiding this comment.
You're probably right; let me think some more about this.
45bc345 to
8196344
Compare
This is a WIP version of a Cranelift IR interpreter. Only a small subset of instructions are implemented and (known) missing parts are marked with TODO or FIXME.
With parsing of annotations, e.g. `; test: %add1(1) == 2`, we can now test the interpretation of Cranelift functions within `.clif` files.
8196344 to
70431e0
Compare
abrown
commented
Jan 22, 2020
| #[derive(Debug)] | ||
| pub struct Frame<'a> { | ||
| /// The currently executing function. | ||
| pub function: &'a Function, |
Member
Author
There was a problem hiding this comment.
Is this better as a FuncRef? I used &'a Function here because it was convenient but it may be more consistent and (possibly?) efficient to use a 4-byte FuncRef here instead. (I probably need to look again at how efficient it is to use FuncRef to index into an Environment).
Contributor
|
Close this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODOorFIXME. This PR is a RFC on the interpreter design; any feedback is welcome.